#include<iostream>
#include<string>
#include<map>
using namespace std;
void test()
{
    //11之前的数组初始化
    int array[] = {1, 2, 3, 4, 5};
    double array2[2] = {1.2, 3.2};
    //对象初始化
    struct Person
    {
        int id;
        double salary;
    } zhang3{1, 300};//都是通过花括号进行初始化
}
//C++11新特性  用花括号进行初始化列表
//不管是设呢类型都可一用花括号进行初始化 中间可以加 = 也可以不加


class Person1
{
    public:
        Person1(int num) : m_num(num){};
        Person1(int num, string name):m_num(num),m_name(name){};


    private:
        int m_num;
        string m_name;
};
int main()
{
    Person1 ti(520);//调用构造函数
    Person1 t2 = 520;//隐式类型转换
    Person1 t3 = {520};//初始化列表
    Person1 t4{520};//初始化列表

    int a1 = {1314};
    int a2{1314};
    int array[] = {1, 2, 3, 4, 5};
    int arr[2]{1, 2};

    int *p = new int{520};
    double b = double{52.1};
    int *array = new int[3]{1, 2, 3};
}